package com.ht;

import lombok.Data;

/**
 * @param <T>
 * @author Mr.Hongtao
 */
@Data
public class Result<T> {
    private int code;
    private String msg;
    private T data;
    public Result(int code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }
    public Result(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public Result() {

    }

    public static <T>Result<T> success(T data) {
        return new Result(200, "success", data);
    }
    public static Result success() {
        return new Result(200, "success");
    }
}
